<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
var maxPower = function(s) {
    let count = 1
    let max = 0
    for( var k = 1 ; k<s.length ; k++ ){
        if( s[k-1] == s[k] ){
            count++
            if( count >= max ){
                max = count
            }
            continue
        }
        
        if( s[k-1] != s[k]  ){
            count = 1
        }
    }

    return max
};

var s = "ccbbbbbhhhh"
console.log(maxPower(s))
    </script>
</body>
</html>